using SG3L_RAG.Domain.Entities;

namespace SG3L_RAG.Application.Interfaces
{
    /// <summary>
    /// JWT令牌服务接口
    /// </summary>
    public interface IJwtTokenService
    {
        /// <summary>
        /// 生成JWT令牌
        /// </summary>
        /// <param name="user">用户实体</param>
        /// <returns>JWT令牌字符串</returns>
        string GenerateToken(User user);

        /// <summary>
        /// 验证JWT令牌
        /// </summary>
        /// <param name="token">JWT令牌</param>
        /// <returns>验证结果</returns>
        bool ValidateToken(string token);

        /// <summary>
        /// 从JWT令牌获取用户ID
        /// </summary>
        /// <param name="token">JWT令牌</param>
        /// <returns>用户ID</returns>
        string? GetUserIdFromToken(string token);

        /// <summary>
        /// 从JWT令牌获取用户名
        /// </summary>
        /// <param name="token">JWT令牌</param>
        /// <returns>用户名</returns>
        string? GetUsernameFromToken(string token);

        /// <summary>
        /// 从JWT令牌获取用户角色
        /// </summary>
        /// <param name="token">JWT令牌</param>
        /// <returns>用户角色</returns>
        string? GetRoleFromToken(string token);
    }
}
